package com.example.productviewservicefeign.controller;

import com.example.productviewservicefeign.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ProductController {

    @Autowired
    private ProductService productService;
    @GetMapping("/products")
    public String listProducts(Model model){
        model.addAttribute("products",productService.listProduct());
        return "products";
    }

}
